﻿using System.Web;
using CharacterModel;
using Framework.Model;
using Framework.Sql;
using MvcApplication1.Services;
using Ninject.Modules;

namespace MvcApplication1.Framework
{
    public class ServiceModule : NinjectModule
    {
        public override void Load()
        {
            Bind<IConnectionConfiguration>().ToConstant(ConnectionStringLoader.Loader);
            Bind<ICache>().To<CacheWrapper>().InRequestScope().WithConstructorArgument("cache", context => HttpContext.Current.Cache);
            Bind<Repository>().ToSelf().InRequestScope();
            Bind<FaceModelFactory>().To<FaceModelFactory>();
        }
    }
}